import React, { Suspense } from 'react';
import ReactDOM from 'react-dom/client';
// import App from './App';
import router from '@/router';
import { Provider } from "react-redux"
import store from "./store";
import Toast from '@/components/Toast/Toast';
import Loading from "@/components/Loading/Loading"

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(
  <Provider store={store}>
    <Toast></Toast>
    {/*懒加载必须配合Suspense使用，使用Suspense的fallback懒加载时候的动画 */}
    <Suspense fallback={<Loading></Loading>}>
      {router}
    </Suspense>
  </Provider>
);
